Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Events a separate entity in management app #3024

Merged
merged 15 commits into from
Jan 9, 2025

Conversation

Jamiras
Copy link
Member

@Jamiras Jamiras commented Jan 7, 2025

Provides a minimalistic events table as suggested here. Much of the data is still managed by the underlying game/achievements objects.

At this point, no events records will exist. The following query should be run on prod after deployment:

INSERT INTO events (legacy_game_id, image_asset_path, slug, active_from, active_until) 
VALUES (32718,'/Images/106174.png','aotw-2025','2025-01-06','2026-01-05');

This PR also adds a new page to the management console (accessible by Event Managers and Administrators - not accessible by Developers) for editing event records. The raw game records are still editable by Developers, but the event extensions no longer appear in the achievement pages. Event achievements are also now their own resource type.

As such, we will need to ensure appropriate users are given the Event Manager role.

image

image

Additionally, I've removed all of the non-event related data from the event game and achievement player-facing pages. I've also removed the dev box from both pages, and the comments field from the achievement page. I believe the only functionality needed from the dev box is adding/removing related games, which is available through the management console.

This includes removing the ability to reset individual event achievements. The player can still reset the entire event via the Progress widget on the event page.

image

image

I have not yet migrated the "Create Event" functionality from the admin blade panel. This PR is big enough already.


If you want to populate events records for all event games, you can run this query:

INSERT INTO events (legacy_game_id, image_asset_path) SELECT ID, ImageIcon FROM GameData WHERE ConsoleID=101;

But I want to try to consolidate some event games into singular event entities after #3020 (and the followup PR for displaying badges) are merged. For example http://localhost:64000/hub/3645 shows 8 event games for AotW 2019. The Bronze/Gold/Silver and # 1, # 2, # 3 games are just for awarding badges, but might require two separate events if players were awarded both. The actual event should be created in a manner similar to the commands listed here. The Spooky and Spring events would be kept separate.

@Jamiras Jamiras added the deployment/sql Includes SQL that needs to be run before/after deployment label Jan 7, 2025
app/Filament/Resources/EventAchievementResource.php Outdated Show resolved Hide resolved
app/Filament/Resources/EventResource.php Outdated Show resolved Hide resolved
Comment on lines +17 to +18
$table->date('active_from')->nullable();
$table->date('active_until')->nullable();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we want indexes on both of these - I reckon they'll probably be queried against very frequently.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this one may have been missed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are only 194 total event games in the database right now, and nothing is filtering on these values yet. I don't think one is needed, but I'm not against adding it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, we can always add it later if it becomes needed.

app/Models/Event.php Outdated Show resolved Hide resolved
app/Models/Event.php Show resolved Hide resolved
@wescopeland wescopeland merged commit f4081ce into RetroAchievements:master Jan 9, 2025
8 checks passed
@Jamiras Jamiras deleted the feature/event_model branch January 9, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment/sql Includes SQL that needs to be run before/after deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants